package version1_4;

/**
 * @program:IntelliJ IDEA
 * @Description:父类的使用
 * @author:Mr.CheCheHuiBujianO
 * @data: 2022/7/12 14:58
 */
public abstract class User {
    //共有属性
    protected String name;
    protected String id;
    protected String gesture;
    //使用protected关键字确保当前对象以及其子类都可以进行对这个属性进行访问
    protected String[] GestureGroup = new String[]{"剪刀","石头","布"};

    public abstract String getName();

    public abstract void setName();

    //公有方法
    public void getId() {
        setId();
        System.out.println("id为"+ id);
    }

    private void setId() {
        Integer idResult = (int) (Math.random()*10000);
        String id = idResult.toString();
        this.id = id;
    }

    public abstract String getGesture();

    public abstract void setGesture();

}
